]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/backlight: Fix keynav within discrete item
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 12 Nov 2024 23:42:56 +0000 (00:42 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 13 Nov 2024 12:32:57 +0000 (12:32 +0000)
When representing the keyboard backlight levels as discrete items,
it is currently not possible to keynav past the first button.

Fix this by bypassing the usual event bubbling and passing key press
events directly to the focus manager, similar to what we do for
popup menu items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3545>

js/ui/status/backlight.js

index 105aabc4772219a225734a275b1e277621ac5936..b39cfa632a7fb53be31353cc93bd926b8fbe7501 100644 (file)
@@ -133,6 +133,10 @@ const DiscreteItem = GObject.registerClass({
         this._levelButtons.set(key, box);
     }
 
+    vfunc_key_press_event(event) {
+        return global.focus_manager.navigate_from_event(event);
+    }
+
     _syncLevels() {
         this._levelButtons.get('off').visible = this.nLevels > 0;
         this._levelButtons.get('high').visible = this.nLevels > 1;